home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: CW9, RTTI, and ODF
- Sent: 8/12/96 12:00 PM
- Received: 8/12/96 12:01 PM
- From: Kirk Swenson, kswenson@keypress.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >Matthew Clay wrote:
- >>
- >> Is that not what a pure virtual member function is all about? The problem
- >> here was that the compiler didn't inform the original poster which pure
- >> virtual(s) were undefined. Most compilers don't, but there isn't anything
- >> preventing them from doing so.
- >
- >Pure virtual functions are functions that are declared in an abstract base
- >class that must be overriden by a subclass. They can optionally be
- >implemented in the class in which they are declared pure virtual. Kirk is
- >suggesting the addition of the ability to explicitly mark an override of a
- >virtual method in the class that overrides the method. He is suggesting
- >that a compile-time error be generated when the compiler sees a method
- >marked override when there is no virtual method with the same signature in
- >a base class.
- >
- >gsf.
-
- Thanks, Greg. I was in the process of formulating a weaker statement of
- this sort when your message arrived, saving me the trouble. I will only
- add that pure virtuals can only catch a subset of the cases that an
- override keyword could, because many method overrides are not overrides of
- pure virtuals. Also, the benefit of receiving the error message at the
- time the class declaration is processed, rather than when another piece of
- code that tries to create the incomplete class is compiled should not be
- overlooked.
-
- Since this isn't really germane to ODF, I suggest that we take this offline
- if further discussion is warranted.
-
- Kirk Swenson
- Senior Software Engineer
- Key Curriculum Press
- kswenson@keypress.com
-
-
-